﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BusinessLayer;

namespace PresentationLayer
{
    public partial class AdicionarResponsavelOficina : Form
    {
        public AdicionarResponsavelOficina()
        {
            InitializeComponent();
        }

        private void AdicionarRespOfic_Click(object sender, EventArgs e)
        {
            this.txtBoxIDOfic.SelectAll();
            this.txtBoxIDFunc.SelectAll();

            String ofic, func;
            if ((ofic = this.txtBoxIDOfic.SelectedText) == "" || (func = this.txtBoxIDFunc.SelectedText) == "")
            {
                MessageBox.Show("Todos os dados são obrigatorios");
                return;
            }

            if(FuncionarioActions.ResponsavelFuncionario(null, ofic, func))
                this.Close();

        }
    }
}
